package com.example.helloword;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.widget.ImageView;

import com.example.helloword.util.ViewPagerAdapter;

public class ViewPageActivity extends Activity {

	private ViewPager viewPager;
	private ViewPagerAdapter adapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.viewpage_main);

		viewPager = (ViewPager) findViewById(R.id.viewpager);
		List<ImageView> imageViews = new ArrayList<ImageView>();

		ImageView view1 = new ImageView(this);
		view1.setImageResource(R.drawable.qq);
		imageViews.add(view1);
		
		ImageView view2 = new ImageView(this);
		view2.setImageResource(R.drawable.xl);
		imageViews.add(view2);
		adapter = new ViewPagerAdapter(this, imageViews);
		viewPager.setAdapter(adapter);
	}

}
